﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.XtraGrid;

namespace IndoorInformation
{
    public class CommonLib
    {
        private static string _ConnectString = "";
        public static string ConnectString
        {
            get
            {
                _ConnectString = "SERVER = 117.6.85.20; DATABASE = RadioMapDBNew; UID= sa; PWD=sqlP2ssw0rd"; //srmdep
                return _ConnectString;
            }
        }

        public static void FormatGridView(DevExpress.XtraGrid.Views.Grid.GridView gridView)
        {
            foreach (DevExpress.XtraGrid.Columns.GridColumn column in gridView.Columns)
            {
                if (column.ColumnType.Name == "DateTime")
                {
                    column.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
                    column.DisplayFormat.FormatString = "dd/MM/yyyy HH:mm";
                }
                if (column.ColumnEdit != null)
                {
                    column.ColumnEdit.NullText = "";
                }
            }
        }
    }
    public enum EditState
    {
        None,
        CreatingNew,
        Modifying,
        Saved,
    }
}
